package org.example.controller;

import org.example.entity.MyUser;
import org.example.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/index")
    public String index() {
        return "Hello security!";
    }

    @GetMapping("/getUser")
    public MyUser getUser(Integer id) {
        return userMapper.getUserById(id);
    }

}
